package com.hzzh.service;

import java.sql.Timestamp;
import java.util.List;

import com.hzzh.dao.MeetingDAO;
import com.hzzh.dao.MeetingParticipantsDAO;
import com.hzzh.vo.Meeting;

public class MeetingService {

	private MeetingDAO meetingDao=new MeetingDAO();
	private MeetingParticipantsDAO parDao=new MeetingParticipantsDAO();
	
	//预定会议
	public void bookMeeting(Meeting meeting,List<Integer> employeeidList){
		int meetingid=meetingDao.insert(meeting);
		for(Integer employeeid:employeeidList){
			parDao.insert(meetingid, employeeid);
		}
	}
	
	//修改更新会议
	public void cancelMeeting(int meetingid){
		meetingDao.update(meetingid, "1", new Timestamp(System.currentTimeMillis()));
	}
	
	//查询某员工参加的所有会议
	public List<Meeting> viewMyBookingInfo(int reservationistid){
		return meetingDao.selectAllMeetingsByReserId(reservationistid);
	}
	
	//参会人员信息
	public List<Meeting> viewMymeetingsInfo(int participantsid){
		return parDao.selectAllMeetingsByParId(participantsid);
	}
}
